//关注与取消
function followfans(userid,authorid,thzs){
	 var that = $(thzs);
	 that.attr("disabled",true);
	 var state = that.data('state');
     if(state == 1 || state == 2){
    	 layer.open({
 	        content: '是否取消关注?',
 	        btn: ['确定', '取消'],
 	        shadeClose: false,
 	        yes: function (index) {
 	        	$.ajax({ 
 	  			 url: '/operate/'+ userid + '/cancel/' + authorid, 
 	  			 type: "POST",
 	  	         data: {},
 	  	         dataType: "json",//请求数据类型
 	  			 success: function(data){
 	  				 layer.close(index);
 	  				 if(data.code == 0){
 	  					 that.removeClass("Summary-liInfo-rfActive");
 	  				     that.text("关注")
 	  				 }else{
 	  					sstb.dialog(data.msg)
 	  				 }
 	  				that.data('state',0);
 	  				that.attr("disabled",false);
 	  			 },
 	  			 error : function() {
 	  				layer.close(index);
 	  				sstb.dialog("取消异常");
 	  				that.attr("disabled",false);
 	  			 }
 	  		 })
 	        }, no: function () {
 	        	that.attr("disabled",false);
 	        }
 	    });
     }else{
    	 $.ajax({ 
    		 url: '/operate/'+ userid + '/follow/' + authorid, 
    		 type: "POST",
            data: {},
            dataType: "json",//请求数据类型
    		 success: function(data){
    			 var result = data.data;
    			 if(data.code == 0){
    				 that.addClass("Summary-liInfo-rfActive");
    				if(result == 1){
    			        that.text("已关注")
    				 }else if(result == 2){
    				    that.text("互为关注")
    				 }
    				that.data('state',result);
    			 }else{
    				 sstb.dialog(data.msg);
    			 }
    			 that.attr("disabled",false);
    		 },
    		 error : function() {
    			 sstb.dialog('关注失败');
    			 that.attr("disabled",false);
    		 }
    	 })
     }
}